package com.rockcent.mall.lib.dto;

import com.rockcent.common.domain.DtoEntity;
import com.rockcent.mall.lib.domain.enumclass.FundTransactionFlow;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;

/**
 * Created by DK on 16/11/21.
 */
public class CustomerFundFlowDto extends DtoEntity {

    //总金额
    private BigDecimal totalAmount;

    //冻结金额
    private BigDecimal frozen;

    //可用金额
    private BigDecimal availableAmount;

    //客户 钱包 ID
    private Long customerFundId;

    //客户ID
    private Long customerId;

    //备注
    private String remark;

    //操作金额
    private BigDecimal operationAmount;

    //交易方向 INCOME("收入", "+"), EXPEND("支出", "-")
    private FundTransactionFlow transactionFlow;

    //交易类型 RECHARGE("充值")
    private String transactionType;

    //平台 id
    private Long mallId;

    //平台订单号 相关订单充值购买,此字段不为空
    private String mallOrderNum;

    /**
     * 开始时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private String beginDate;

    /**
     * 结束时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private String endDate;

    //支付方式
    private String paymentMethod;


    //操作金额
    private String operationAmountShow;

    public BigDecimal getTotalAmount() {
        return totalAmount.setScale(2, BigDecimal.ROUND_HALF_UP);
    }

    public void setTotalAmount(BigDecimal totalAmount) {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getFrozen() {
        return frozen.setScale(2, BigDecimal.ROUND_HALF_UP);
    }

    public void setFrozen(BigDecimal frozen) {
        this.frozen = frozen;
    }

    public BigDecimal getAvailableAmount() {
        return availableAmount.setScale(2, BigDecimal.ROUND_HALF_UP);
    }

    public void setAvailableAmount(BigDecimal availableAmount) {
        this.availableAmount = availableAmount;
    }

    public Long getCustomerFundId() {
        return customerFundId;
    }

    public void setCustomerFundId(Long customerFundId) {
        this.customerFundId = customerFundId;
    }

    public Long getCustomerId() {
        return customerId;
    }

    public void setCustomerId(Long customerId) {
        this.customerId = customerId;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public BigDecimal getOperationAmount() {
        return operationAmount.setScale(2,BigDecimal.ROUND_HALF_UP);
    }

    public void setOperationAmount(BigDecimal operationAmount) {
        this.operationAmount = operationAmount;
    }

    public FundTransactionFlow getTransactionFlow() {
        return transactionFlow;
    }

    public void setTransactionFlow(FundTransactionFlow transactionFlow) {
        this.transactionFlow = transactionFlow;
    }

    public String getTransactionType() {
        return transactionType;
    }

    public void setTransactionType(String transactionType) {
        this.transactionType = transactionType;
    }

    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    public String getMallOrderNum() {
        return mallOrderNum;
    }

    public void setMallOrderNum(String mallOrderNum) {
        this.mallOrderNum = mallOrderNum;
    }

    public String getEndDate() {
        return endDate;
    }

    public void setEndDate(String endDate) {
        this.endDate = endDate;
    }

    public String getBeginDate() {
        return beginDate;
    }

    public void setBeginDate(String beginDate) {
        this.beginDate = beginDate;
    }

    public String getPaymentMethod() {
        return paymentMethod;
    }

    public void setPaymentMethod(String paymentMethod) {
        this.paymentMethod = paymentMethod;
    }

    public String getOperationAmountShow() {
        return operationAmountShow;
    }

    public void setOperationAmountShow(String operationAmountShow) {
        this.operationAmountShow = operationAmountShow;
    }

    @Override
    public String toString() {
        return "CustomerFundFlowDto{" +
                "totalAmount=" + totalAmount +
                ", frozen=" + frozen +
                ", availableAmount=" + availableAmount +
                ", customerFundId=" + customerFundId +
                ", customerId=" + customerId +
                ", remark='" + remark + '\'' +
                ", operationAmount=" + operationAmount +
                ", transactionFlow=" + transactionFlow +
                ", transactionType='" + transactionType + '\'' +
                ", mallId=" + mallId +
                ", mallOrderNum='" + mallOrderNum + '\'' +
                ", beginDate='" + beginDate + '\'' +
                ", endDate='" + endDate + '\'' +
                ", paymentMethod='" + paymentMethod + '\'' +
                ", operationAmountShow='" + operationAmountShow + '\'' +
                '}';
    }
}
